package NodeList;

import java.util.Stack;

/**
 * @ Author     ：侯耀祖
 * @ Description：
 */
public class reverseList {
    public ListNode reverseList(ListNode head) {
        ListNode node = new ListNode();
        ListNode result = null;
        node = head;
        while (node != null){
            result = new ListNode(node.val, result);
            node = node.next;
        }
        return result;
    }

}
